/*
 * @Author: zxh
 * @Date: 2024-07-29 15:53:05
 * @LastEditors: zxh
 * @LastEditTime: 2024-07-29 17:09:27
 * @Description: 请填写简介
 */
import http from '@/utils/http'

export const getDetail = (id: any) => {
  return <any>http({
    url: '/goods',
    params: {
      id
    }
  })
}

/**
 * 获取热榜商品
 * @param {Number} id - 商品id
 * @param {Number} type - 1代表24小时热销榜 2代表周热销榜
 * @param {Number} limit - 获取个数
 */
export const fetchHotGoodsAPI = ({ id = 0, type = 0, limit = 3 }) => {
  return <any>http({
    url: '/goods/hot',
    params: {
      id,
      type,
      limit
    }
  })
}
